<?php
header("Content-type:text/html;charset=utf-8;");

if (version_compare(PHP_VERSION, '5.3.0', '<')) {
    die('require PHP > 5.3.0 !');
}

define('ROOT_DIR', dirname(dirname(__FILE__)));

/* 过滤script */


$action = [
    '/ArticleCrawler/saveArticleCrawler',
    '/Article/saveExpert',
    '/Article/save',
    '/Activity/addActivityData',
    '/Activity/saveActivityData',
    '/Activity/saveActivityIntro',
    '/Activity/saveActivityRules'
];

if (!in_array($_SERVER['REQUEST_URI'], $action)) {
    loopScript($_GET);
    loopScript($_POST);
    loopScript($_REQUEST);
}

function loopScript(&$arr)
{
    if (is_array($arr)) {
        foreach ($arr as $key => $val) {
            if (is_array($val)) {
                loopScript($arr[$key]);
            } else {
                $arr[$key] = strip_tags($val);
            }
        }
    }
}


/**
 * 系统调试设置
 * 项目正式部署后请设置为false
 */
define('APP_DEBUG', true);
define('APP_STATUS', 'dev');
define('BIND_MODULE', 'AuctionBack');
define('APP_PHPUNIT', false);

/**
 * 应用目录设置
 * 安全期间，建议安装调试完成后移动到非WEB目录
 */
define('APP_PATH', '../App/');
/**
 * 缓存目录设置
 * 此目录必须可写，建议移动到非WEB目录
 */
define('RUNTIME_PATH', '../Run/');


define('WEB_PATH', dirname(__FILE__));
define("WEB_URL", "http://" . $_SERVER['HTTP_HOST'] . '/');

/**
 * 引入核心入口
 * ThinkPHP亦可移动到WEB以外的目录
 */
require '../TP/ThinkPHP.php';
